Files: docs/references/*
Copyright: UnionTech Software Technology Co., Ltd.
License: CC-BY-4.0
+
+
+Files: toolGenerate/**/*
+Copyright: None
+License: CC0-1.0
cmake_parse_arguments(
"arg"
""
- "OUTPUT_FILE_NAME;CLASS_NAME;USE_QPROPERTY"
+ "OUTPUT_FILE_NAME;CLASS_NAME"
""
${ARGN}
)
set(CLASS_NAME_ARG "")
endif()
- if(NOT DEFINED arg_USE_QPROPERTY)
- if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
- set(arg_USE_QPROPERTY ON)
- endif()
- endif()
-
- if (arg_USE_QPROPERTY)
- set(USE_QPROPERTY_ARG "--use-qproperty")
- else()
- set(USE_QPROPERTY_ARG "")
- endif()
-
# Add a custom command to run dconfig2cpp
add_custom_command(
OUTPUT ${OUTPUT_HEADER}
- COMMAND ${DTK_DCONFIG2CPP} -o ${OUTPUT_HEADER} ${CLASS_NAME_ARG} ${USE_QPROPERTY_ARG} ${JSON_FILE}
+ COMMAND ${DTK_DCONFIG2CPP} -o ${OUTPUT_HEADER} ${CLASS_NAME_ARG} ${JSON_FILE}
DEPENDS ${JSON_FILE} ${DTK_XML2CPP}
COMMENT "Generating ${OUTPUT_HEADER} from ${JSON_FILE}"
VERBATIM
+dtkcore (5.7.12) unstable; urgency=medium
+
+ * feat: dconfig2cpp always add bindableFoo functions on Qt6
+ * feat: Add files generated by qdbusXML2cpp and DCONG2cpp
+
+ -- YeShanShan <yeshanshan@uniontech.com> Thu, 06 Mar 2025 17:29:21 +0800
+
dtkcore (5.7.11) unstable; urgency=medium
* feat: dconfig2cpp generated codes supports qml
/**
* This file is generated by dconfig2cpp.
* Command line arguments: /home/zccrs/projects/dtkcore/build/unknown-Debug/tools/dconfig2cpp/dconfig2cpp /home/zccrs/projects/dtkcommon/configs/org.deepin.dtk.preference.json
- * Generation time: 2025-02-21T13:49:21
+ * Generation time: 2025-03-06T10:40:41
* JSON file version: 1.0
*
* WARNING: DO NOT MODIFY THIS FILE MANUALLY.
#include <QDebug>
#include <QAtomicPointer>
#include <QAtomicInteger>
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+#include <QProperty>
+#endif
#include <DConfig>
class dconfig_org_deepin_dtk_preference : public QObject {
}
Q_INVOKABLE QStringList keyList() const {
- return { QStringLiteral(u"\u0061\u0075\u0074\u006f\u0044\u0069\u0073\u0070\u006c\u0061\u0079\u0046\u0065\u0061\u0074\u0075\u0072\u0065"),
- QStringLiteral(u"\u0066\u0065\u0061\u0074\u0075\u0072\u0065\u0055\u0070\u0064\u0061\u0074\u0065\u0064"),
- QStringLiteral(u"\u006b\u0065\u0079\u0062\u006f\u0061\u0072\u0064\u0073\u0065\u0061\u0072\u0063\u0068\u0044\u0069\u0073\u0061\u0062\u006c\u0065\u0064"),
- QStringLiteral(u"\u0072\u0075\u006c\u0065\u0073"),
- QStringLiteral(u"\u0074\u0068\u0065\u006d\u0065\u0054\u0079\u0070\u0065"),
- QStringLiteral(u"\u0074\u0069\u0074\u006c\u0065\u0062\u0061\u0072\u0048\u0065\u0069\u0067\u0068\u0074"),
- QStringLiteral(u"\u0075\u006e\u0064\u0065\u0072\u006c\u0069\u006e\u0065\u0053\u0068\u006f\u0072\u0074\u0063\u0075\u0074")};
+ return { QStringLiteral("autoDisplayFeature"),
+ QStringLiteral("featureUpdated"),
+ QStringLiteral("keyboardsearchDisabled"),
+ QStringLiteral("rules"),
+ QStringLiteral("themeType"),
+ QStringLiteral("titlebarHeight"),
+ QStringLiteral("underlineShortcut")};
}
Q_INVOKABLE bool isDefaultValue(const QString &key) const {
- if (key == QStringLiteral(u"\u0061\u0075\u0074\u006f\u0044\u0069\u0073\u0070\u006c\u0061\u0079\u0046\u0065\u0061\u0074\u0075\u0072\u0065"))
+ if (key == QStringLiteral("autoDisplayFeature"))
return autoDisplayFeatureIsDefaultValue();
- if (key == QStringLiteral(u"\u0066\u0065\u0061\u0074\u0075\u0072\u0065\u0055\u0070\u0064\u0061\u0074\u0065\u0064"))
+ if (key == QStringLiteral("featureUpdated"))
return featureUpdatedIsDefaultValue();
- if (key == QStringLiteral(u"\u006b\u0065\u0079\u0062\u006f\u0061\u0072\u0064\u0073\u0065\u0061\u0072\u0063\u0068\u0044\u0069\u0073\u0061\u0062\u006c\u0065\u0064"))
+ if (key == QStringLiteral("keyboardsearchDisabled"))
return keyboardsearchDisabledIsDefaultValue();
- if (key == QStringLiteral(u"\u0072\u0075\u006c\u0065\u0073"))
+ if (key == QStringLiteral("rules"))
return rulesIsDefaultValue();
- if (key == QStringLiteral(u"\u0074\u0068\u0065\u006d\u0065\u0054\u0079\u0070\u0065"))
+ if (key == QStringLiteral("themeType"))
return themeTypeIsDefaultValue();
- if (key == QStringLiteral(u"\u0074\u0069\u0074\u006c\u0065\u0062\u0061\u0072\u0048\u0065\u0069\u0067\u0068\u0074"))
+ if (key == QStringLiteral("titlebarHeight"))
return titlebarHeightIsDefaultValue();
- if (key == QStringLiteral(u"\u0075\u006e\u0064\u0065\u0072\u006c\u0069\u006e\u0065\u0053\u0068\u006f\u0072\u0074\u0063\u0075\u0074"))
+ if (key == QStringLiteral("underlineShortcut"))
return underlineShortcutIsDefaultValue();
return false;
}
markPropertySet(0);
if (auto config = m_config.loadRelaxed()) {
QMetaObject::invokeMethod(config, [this, value]() {
- m_config.loadRelaxed()->setValue(QStringLiteral(u"\u0061\u0075\u0074\u006f\u0044\u0069\u0073\u0070\u006c\u0061\u0079\u0046\u0065\u0061\u0074\u0075\u0072\u0065"), value);
+ m_config.loadRelaxed()->setValue(QStringLiteral("autoDisplayFeature"), value);
});
}
if (p_autoDisplayFeature != oldValue) {
Q_EMIT autoDisplayFeatureChanged();
- Q_EMIT valueChanged(QStringLiteral(u"\u0061\u0075\u0074\u006f\u0044\u0069\u0073\u0070\u006c\u0061\u0079\u0046\u0065\u0061\u0074\u0075\u0072\u0065"), value);
+ Q_EMIT valueChanged(QStringLiteral("autoDisplayFeature"), value);
}
}
void resetAutoDisplayFeature() {
if (auto config = m_config.loadRelaxed()) {
QMetaObject::invokeMethod(config, [this]() {
- m_config.loadRelaxed()->reset(QStringLiteral(u"\u0061\u0075\u0074\u006f\u0044\u0069\u0073\u0070\u006c\u0061\u0079\u0046\u0065\u0061\u0074\u0075\u0072\u0065"));
+ m_config.loadRelaxed()->reset(QStringLiteral("autoDisplayFeature"));
});
}
}
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ QBindable<bool> bindableAutoDisplayFeature() {
+ return QBindable<bool>(this, QStringLiteral("autoDisplayFeature"));
+ }
+#endif
Q_INVOKABLE bool autoDisplayFeatureIsDefaultValue() const {
return !testPropertySet(0);
}
markPropertySet(1);
if (auto config = m_config.loadRelaxed()) {
QMetaObject::invokeMethod(config, [this, value]() {
- m_config.loadRelaxed()->setValue(QStringLiteral(u"\u0066\u0065\u0061\u0074\u0075\u0072\u0065\u0055\u0070\u0064\u0061\u0074\u0065\u0064"), value);
+ m_config.loadRelaxed()->setValue(QStringLiteral("featureUpdated"), value);
});
}
if (p_featureUpdated != oldValue) {
Q_EMIT featureUpdatedChanged();
- Q_EMIT valueChanged(QStringLiteral(u"\u0066\u0065\u0061\u0074\u0075\u0072\u0065\u0055\u0070\u0064\u0061\u0074\u0065\u0064"), value);
+ Q_EMIT valueChanged(QStringLiteral("featureUpdated"), value);
}
}
void resetFeatureUpdated() {
if (auto config = m_config.loadRelaxed()) {
QMetaObject::invokeMethod(config, [this]() {
- m_config.loadRelaxed()->reset(QStringLiteral(u"\u0066\u0065\u0061\u0074\u0075\u0072\u0065\u0055\u0070\u0064\u0061\u0074\u0065\u0064"));
+ m_config.loadRelaxed()->reset(QStringLiteral("featureUpdated"));
});
}
}
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ QBindable<bool> bindableFeatureUpdated() {
+ return QBindable<bool>(this, QStringLiteral("featureUpdated"));
+ }
+#endif
Q_INVOKABLE bool featureUpdatedIsDefaultValue() const {
return !testPropertySet(1);
}
markPropertySet(2);
if (auto config = m_config.loadRelaxed()) {
QMetaObject::invokeMethod(config, [this, value]() {
- m_config.loadRelaxed()->setValue(QStringLiteral(u"\u006b\u0065\u0079\u0062\u006f\u0061\u0072\u0064\u0073\u0065\u0061\u0072\u0063\u0068\u0044\u0069\u0073\u0061\u0062\u006c\u0065\u0064"), value);
+ m_config.loadRelaxed()->setValue(QStringLiteral("keyboardsearchDisabled"), value);
});
}
if (p_keyboardsearchDisabled != oldValue) {
Q_EMIT keyboardsearchDisabledChanged();
- Q_EMIT valueChanged(QStringLiteral(u"\u006b\u0065\u0079\u0062\u006f\u0061\u0072\u0064\u0073\u0065\u0061\u0072\u0063\u0068\u0044\u0069\u0073\u0061\u0062\u006c\u0065\u0064"), value);
+ Q_EMIT valueChanged(QStringLiteral("keyboardsearchDisabled"), value);
}
}
void resetKeyboardsearchDisabled() {
if (auto config = m_config.loadRelaxed()) {
QMetaObject::invokeMethod(config, [this]() {
- m_config.loadRelaxed()->reset(QStringLiteral(u"\u006b\u0065\u0079\u0062\u006f\u0061\u0072\u0064\u0073\u0065\u0061\u0072\u0063\u0068\u0044\u0069\u0073\u0061\u0062\u006c\u0065\u0064"));
+ m_config.loadRelaxed()->reset(QStringLiteral("keyboardsearchDisabled"));
});
}
}
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ QBindable<bool> bindableKeyboardsearchDisabled() {
+ return QBindable<bool>(this, QStringLiteral("keyboardsearchDisabled"));
+ }
+#endif
Q_INVOKABLE bool keyboardsearchDisabledIsDefaultValue() const {
return !testPropertySet(2);
}
markPropertySet(3);
if (auto config = m_config.loadRelaxed()) {
QMetaObject::invokeMethod(config, [this, value]() {
- m_config.loadRelaxed()->setValue(QStringLiteral(u"\u0072\u0075\u006c\u0065\u0073"), value);
+ m_config.loadRelaxed()->setValue(QStringLiteral("rules"), value);
});
}
if (p_rules != oldValue) {
Q_EMIT rulesChanged();
- Q_EMIT valueChanged(QStringLiteral(u"\u0072\u0075\u006c\u0065\u0073"), value);
+ Q_EMIT valueChanged(QStringLiteral("rules"), value);
}
}
void resetRules() {
if (auto config = m_config.loadRelaxed()) {
QMetaObject::invokeMethod(config, [this]() {
- m_config.loadRelaxed()->reset(QStringLiteral(u"\u0072\u0075\u006c\u0065\u0073"));
+ m_config.loadRelaxed()->reset(QStringLiteral("rules"));
});
}
}
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ QBindable<QString> bindableRules() {
+ return QBindable<QString>(this, QStringLiteral("rules"));
+ }
+#endif
Q_INVOKABLE bool rulesIsDefaultValue() const {
return !testPropertySet(3);
}
markPropertySet(4);
if (auto config = m_config.loadRelaxed()) {
QMetaObject::invokeMethod(config, [this, value]() {
- m_config.loadRelaxed()->setValue(QStringLiteral(u"\u0074\u0068\u0065\u006d\u0065\u0054\u0079\u0070\u0065"), value);
+ m_config.loadRelaxed()->setValue(QStringLiteral("themeType"), value);
});
}
if (p_themeType != oldValue) {
Q_EMIT themeTypeChanged();
- Q_EMIT valueChanged(QStringLiteral(u"\u0074\u0068\u0065\u006d\u0065\u0054\u0079\u0070\u0065"), value);
+ Q_EMIT valueChanged(QStringLiteral("themeType"), value);
}
}
void resetThemeType() {
if (auto config = m_config.loadRelaxed()) {
QMetaObject::invokeMethod(config, [this]() {
- m_config.loadRelaxed()->reset(QStringLiteral(u"\u0074\u0068\u0065\u006d\u0065\u0054\u0079\u0070\u0065"));
+ m_config.loadRelaxed()->reset(QStringLiteral("themeType"));
});
}
}
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ QBindable<qlonglong> bindableThemeType() {
+ return QBindable<qlonglong>(this, QStringLiteral("themeType"));
+ }
+#endif
Q_INVOKABLE bool themeTypeIsDefaultValue() const {
return !testPropertySet(4);
}
markPropertySet(5);
if (auto config = m_config.loadRelaxed()) {
QMetaObject::invokeMethod(config, [this, value]() {
- m_config.loadRelaxed()->setValue(QStringLiteral(u"\u0074\u0069\u0074\u006c\u0065\u0062\u0061\u0072\u0048\u0065\u0069\u0067\u0068\u0074"), value);
+ m_config.loadRelaxed()->setValue(QStringLiteral("titlebarHeight"), value);
});
}
if (p_titlebarHeight != oldValue) {
Q_EMIT titlebarHeightChanged();
- Q_EMIT valueChanged(QStringLiteral(u"\u0074\u0069\u0074\u006c\u0065\u0062\u0061\u0072\u0048\u0065\u0069\u0067\u0068\u0074"), value);
+ Q_EMIT valueChanged(QStringLiteral("titlebarHeight"), value);
}
}
void resetTitlebarHeight() {
if (auto config = m_config.loadRelaxed()) {
QMetaObject::invokeMethod(config, [this]() {
- m_config.loadRelaxed()->reset(QStringLiteral(u"\u0074\u0069\u0074\u006c\u0065\u0062\u0061\u0072\u0048\u0065\u0069\u0067\u0068\u0074"));
+ m_config.loadRelaxed()->reset(QStringLiteral("titlebarHeight"));
});
}
}
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ QBindable<qlonglong> bindableTitlebarHeight() {
+ return QBindable<qlonglong>(this, QStringLiteral("titlebarHeight"));
+ }
+#endif
Q_INVOKABLE bool titlebarHeightIsDefaultValue() const {
return !testPropertySet(5);
}
markPropertySet(6);
if (auto config = m_config.loadRelaxed()) {
QMetaObject::invokeMethod(config, [this, value]() {
- m_config.loadRelaxed()->setValue(QStringLiteral(u"\u0075\u006e\u0064\u0065\u0072\u006c\u0069\u006e\u0065\u0053\u0068\u006f\u0072\u0074\u0063\u0075\u0074"), value);
+ m_config.loadRelaxed()->setValue(QStringLiteral("underlineShortcut"), value);
});
}
if (p_underlineShortcut != oldValue) {
Q_EMIT underlineShortcutChanged();
- Q_EMIT valueChanged(QStringLiteral(u"\u0075\u006e\u0064\u0065\u0072\u006c\u0069\u006e\u0065\u0053\u0068\u006f\u0072\u0074\u0063\u0075\u0074"), value);
+ Q_EMIT valueChanged(QStringLiteral("underlineShortcut"), value);
}
}
void resetUnderlineShortcut() {
if (auto config = m_config.loadRelaxed()) {
QMetaObject::invokeMethod(config, [this]() {
- m_config.loadRelaxed()->reset(QStringLiteral(u"\u0075\u006e\u0064\u0065\u0072\u006c\u0069\u006e\u0065\u0053\u0068\u006f\u0072\u0074\u0063\u0075\u0074"));
+ m_config.loadRelaxed()->reset(QStringLiteral("underlineShortcut"));
});
}
}
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ QBindable<bool> bindableUnderlineShortcut() {
+ return QBindable<bool>(this, QStringLiteral("underlineShortcut"));
+ }
+#endif
Q_INVOKABLE bool underlineShortcutIsDefaultValue() const {
return !testPropertySet(6);
}
}
if (testPropertySet(0)) {
- config->setValue(QStringLiteral(u"\u0061\u0075\u0074\u006f\u0044\u0069\u0073\u0070\u006c\u0061\u0079\u0046\u0065\u0061\u0074\u0075\u0072\u0065"), QVariant::fromValue(p_autoDisplayFeature));
+ config->setValue(QStringLiteral("autoDisplayFeature"), QVariant::fromValue(p_autoDisplayFeature));
} else {
- updateValue(QStringLiteral(u"\u0061\u0075\u0074\u006f\u0044\u0069\u0073\u0070\u006c\u0061\u0079\u0046\u0065\u0061\u0074\u0075\u0072\u0065"), QVariant::fromValue(p_autoDisplayFeature));
+ updateValue(QStringLiteral("autoDisplayFeature"), QVariant::fromValue(p_autoDisplayFeature));
}
if (testPropertySet(1)) {
- config->setValue(QStringLiteral(u"\u0066\u0065\u0061\u0074\u0075\u0072\u0065\u0055\u0070\u0064\u0061\u0074\u0065\u0064"), QVariant::fromValue(p_featureUpdated));
+ config->setValue(QStringLiteral("featureUpdated"), QVariant::fromValue(p_featureUpdated));
} else {
- updateValue(QStringLiteral(u"\u0066\u0065\u0061\u0074\u0075\u0072\u0065\u0055\u0070\u0064\u0061\u0074\u0065\u0064"), QVariant::fromValue(p_featureUpdated));
+ updateValue(QStringLiteral("featureUpdated"), QVariant::fromValue(p_featureUpdated));
}
if (testPropertySet(2)) {
- config->setValue(QStringLiteral(u"\u006b\u0065\u0079\u0062\u006f\u0061\u0072\u0064\u0073\u0065\u0061\u0072\u0063\u0068\u0044\u0069\u0073\u0061\u0062\u006c\u0065\u0064"), QVariant::fromValue(p_keyboardsearchDisabled));
+ config->setValue(QStringLiteral("keyboardsearchDisabled"), QVariant::fromValue(p_keyboardsearchDisabled));
} else {
- updateValue(QStringLiteral(u"\u006b\u0065\u0079\u0062\u006f\u0061\u0072\u0064\u0073\u0065\u0061\u0072\u0063\u0068\u0044\u0069\u0073\u0061\u0062\u006c\u0065\u0064"), QVariant::fromValue(p_keyboardsearchDisabled));
+ updateValue(QStringLiteral("keyboardsearchDisabled"), QVariant::fromValue(p_keyboardsearchDisabled));
}
if (testPropertySet(3)) {
- config->setValue(QStringLiteral(u"\u0072\u0075\u006c\u0065\u0073"), QVariant::fromValue(p_rules));
+ config->setValue(QStringLiteral("rules"), QVariant::fromValue(p_rules));
} else {
- updateValue(QStringLiteral(u"\u0072\u0075\u006c\u0065\u0073"), QVariant::fromValue(p_rules));
+ updateValue(QStringLiteral("rules"), QVariant::fromValue(p_rules));
}
if (testPropertySet(4)) {
- config->setValue(QStringLiteral(u"\u0074\u0068\u0065\u006d\u0065\u0054\u0079\u0070\u0065"), QVariant::fromValue(p_themeType));
+ config->setValue(QStringLiteral("themeType"), QVariant::fromValue(p_themeType));
} else {
- updateValue(QStringLiteral(u"\u0074\u0068\u0065\u006d\u0065\u0054\u0079\u0070\u0065"), QVariant::fromValue(p_themeType));
+ updateValue(QStringLiteral("themeType"), QVariant::fromValue(p_themeType));
}
if (testPropertySet(5)) {
- config->setValue(QStringLiteral(u"\u0074\u0069\u0074\u006c\u0065\u0062\u0061\u0072\u0048\u0065\u0069\u0067\u0068\u0074"), QVariant::fromValue(p_titlebarHeight));
+ config->setValue(QStringLiteral("titlebarHeight"), QVariant::fromValue(p_titlebarHeight));
} else {
- updateValue(QStringLiteral(u"\u0074\u0069\u0074\u006c\u0065\u0062\u0061\u0072\u0048\u0065\u0069\u0067\u0068\u0074"), QVariant::fromValue(p_titlebarHeight));
+ updateValue(QStringLiteral("titlebarHeight"), QVariant::fromValue(p_titlebarHeight));
}
if (testPropertySet(6)) {
- config->setValue(QStringLiteral(u"\u0075\u006e\u0064\u0065\u0072\u006c\u0069\u006e\u0065\u0053\u0068\u006f\u0072\u0074\u0063\u0075\u0074"), QVariant::fromValue(p_underlineShortcut));
+ config->setValue(QStringLiteral("underlineShortcut"), QVariant::fromValue(p_underlineShortcut));
} else {
- updateValue(QStringLiteral(u"\u0075\u006e\u0064\u0065\u0072\u006c\u0069\u006e\u0065\u0053\u0068\u006f\u0072\u0074\u0063\u0075\u0074"), QVariant::fromValue(p_underlineShortcut));
+ updateValue(QStringLiteral("underlineShortcut"), QVariant::fromValue(p_underlineShortcut));
}
connect(config, &DTK_CORE_NAMESPACE::DConfig::valueChanged, this, [this](const QString &key) {
void updateValue(const QString &key, const QVariant &fallback = QVariant()) {
Q_ASSERT(QThread::currentThread() == m_config.loadRelaxed()->thread());
const QVariant &value = m_config.loadRelaxed()->value(key, fallback);
- if (key == QStringLiteral(u"\u0061\u0075\u0074\u006f\u0044\u0069\u0073\u0070\u006c\u0061\u0079\u0046\u0065\u0061\u0074\u0075\u0072\u0065")) {
+ if (key == QStringLiteral("autoDisplayFeature")) {
markPropertySet(0, !m_config.loadRelaxed()->isDefaultValue(key));
auto newValue = qvariant_cast<bool>(value);
QMetaObject::invokeMethod(this, [this, newValue, key, value]() {
});
return;
}
- if (key == QStringLiteral(u"\u0066\u0065\u0061\u0074\u0075\u0072\u0065\u0055\u0070\u0064\u0061\u0074\u0065\u0064")) {
+ if (key == QStringLiteral("featureUpdated")) {
markPropertySet(1, !m_config.loadRelaxed()->isDefaultValue(key));
auto newValue = qvariant_cast<bool>(value);
QMetaObject::invokeMethod(this, [this, newValue, key, value]() {
});
return;
}
- if (key == QStringLiteral(u"\u006b\u0065\u0079\u0062\u006f\u0061\u0072\u0064\u0073\u0065\u0061\u0072\u0063\u0068\u0044\u0069\u0073\u0061\u0062\u006c\u0065\u0064")) {
+ if (key == QStringLiteral("keyboardsearchDisabled")) {
markPropertySet(2, !m_config.loadRelaxed()->isDefaultValue(key));
auto newValue = qvariant_cast<bool>(value);
QMetaObject::invokeMethod(this, [this, newValue, key, value]() {
});
return;
}
- if (key == QStringLiteral(u"\u0072\u0075\u006c\u0065\u0073")) {
+ if (key == QStringLiteral("rules")) {
markPropertySet(3, !m_config.loadRelaxed()->isDefaultValue(key));
auto newValue = qvariant_cast<QString>(value);
QMetaObject::invokeMethod(this, [this, newValue, key, value]() {
});
return;
}
- if (key == QStringLiteral(u"\u0074\u0068\u0065\u006d\u0065\u0054\u0079\u0070\u0065")) {
+ if (key == QStringLiteral("themeType")) {
markPropertySet(4, !m_config.loadRelaxed()->isDefaultValue(key));
auto newValue = qvariant_cast<qlonglong>(value);
QMetaObject::invokeMethod(this, [this, newValue, key, value]() {
});
return;
}
- if (key == QStringLiteral(u"\u0074\u0069\u0074\u006c\u0065\u0062\u0061\u0072\u0048\u0065\u0069\u0067\u0068\u0074")) {
+ if (key == QStringLiteral("titlebarHeight")) {
markPropertySet(5, !m_config.loadRelaxed()->isDefaultValue(key));
auto newValue = qvariant_cast<qlonglong>(value);
QMetaObject::invokeMethod(this, [this, newValue, key, value]() {
});
return;
}
- if (key == QStringLiteral(u"\u0075\u006e\u0064\u0065\u0072\u006c\u0069\u006e\u0065\u0053\u0068\u006f\u0072\u0074\u0063\u0075\u0074")) {
+ if (key == QStringLiteral("underlineShortcut")) {
markPropertySet(6, !m_config.loadRelaxed()->isDefaultValue(key));
auto newValue = qvariant_cast<bool>(value);
QMetaObject::invokeMethod(this, [this, newValue, key, value]() {
--- /dev/null
+/**
+ * This file is generated by dconfig2cpp.
+ * Command line arguments: ./dconfig2cpp -p ./dtkcore/toolGenerate/dconfig2cpp ./dtkcore/tests/data/dconf-example.meta.json
+ * Generation time: 2025-01-14T10:54:59
+ * JSON file version: 1.0
+ *
+ * WARNING: DO NOT MODIFY THIS FILE MANUALLY.
+ * If you need to change the content, please modify the dconfig2cpp tool.
+ */
+
+#ifndef DCONF-EXAMPLE_META_H
+#define DCONF-EXAMPLE_META_H
+
+#include <QThread>
+#include <QVariant>
+#include <QDebug>
+#include <QAtomicPointer>
+#include <QAtomicInteger>
+#include <DConfig>
+
+class dconf-example_meta : public QObject {
+ Q_OBJECT
+
+ Q_PROPERTY(QList<QVariant> array READ array WRITE setArray NOTIFY arrayChanged)
+ Q_PROPERTY(QList<QVariant> array_map READ array_map WRITE setArray_map NOTIFY array_mapChanged)
+ Q_PROPERTY(QList<QVariant> array_map_struct READ array_map_struct WRITE setArray_map_struct NOTIFY array_map_structChanged)
+ Q_PROPERTY(bool canExit READ canExit WRITE setCanExit NOTIFY canExitChanged)
+ Q_PROPERTY(QString key2 READ key2 WRITE setKey2 NOTIFY key2Changed)
+ Q_PROPERTY(QString key3 READ key3 WRITE setKey3 NOTIFY key3Changed)
+ Q_PROPERTY(QVariantMap map READ map WRITE setMap NOTIFY mapChanged)
+ Q_PROPERTY(QVariantMap map_array READ map_array WRITE setMap_array NOTIFY map_arrayChanged)
+ Q_PROPERTY(double number READ number WRITE setNumber NOTIFY numberChanged)
+ Q_PROPERTY(double numberDouble READ numberDouble WRITE setNumberDouble NOTIFY numberDoubleChanged)
+ Q_PROPERTY(bool publicConfig READ publicConfig WRITE setPublicConfig NOTIFY publicConfigChanged)
+ Q_PROPERTY(QVariantMap struct READ struct WRITE setStruct NOTIFY structChanged)
+public:
+ explicit dconf-example_meta(QThread *thread, const QString &appId, const QString &name, const QString &subpath, QObject *parent = nullptr)
+ : QObject(parent) {
+
+ if (!thread->isRunning()) {
+ qWarning() << QStringLiteral("Warning: The provided thread is not running.");
+ }
+ Q_ASSERT(QThread::currentThread() != thread);
+ auto worker = new QObject();
+ worker->moveToThread(thread);
+ QMetaObject::invokeMethod(worker, [=]() {
+ auto config = DTK_CORE_NAMESPACE::DConfig::create(appId, name, subpath, nullptr);
+ if (!config) {
+ qWarning() << QStringLiteral("Failed to create DConfig instance.");
+ worker->deleteLater();
+ return;
+ }
+ config->moveToThread(QThread::currentThread());
+ initialize(config);
+ worker->deleteLater();
+ });
+ }
+ explicit dconf-example_meta(QThread *thread, DTK_CORE_NAMESPACE::DConfigBackend *backend, const QString &appId, const QString &name, const QString &subpath, QObject *parent = nullptr)
+ : QObject(parent) {
+
+ if (!thread->isRunning()) {
+ qWarning() << QStringLiteral("Warning: The provided thread is not running.");
+ }
+ Q_ASSERT(QThread::currentThread() != thread);
+ auto worker = new QObject();
+ worker->moveToThread(thread);
+ QMetaObject::invokeMethod(worker, [=]() {
+ auto config = DTK_CORE_NAMESPACE::DConfig::create(backend, appId, name, subpath, nullptr);
+ if (!config) {
+ qWarning() << QStringLiteral("Failed to create DConfig instance.");
+ worker->deleteLater();
+ return;
+ }
+ config->moveToThread(QThread::currentThread());
+ initialize(config);
+ worker->deleteLater();
+ });
+ }
+ explicit dconf-example_meta(QThread *thread, const QString &name, const QString &subpath, QObject *parent = nullptr)
+ : QObject(parent) {
+
+ if (!thread->isRunning()) {
+ qWarning() << QStringLiteral("Warning: The provided thread is not running.");
+ }
+ Q_ASSERT(QThread::currentThread() != thread);
+ auto worker = new QObject();
+ worker->moveToThread(thread);
+ QMetaObject::invokeMethod(worker, [=]() {
+ auto config = DTK_CORE_NAMESPACE::DConfig::create(name, subpath, nullptr);
+ if (!config) {
+ qWarning() << QStringLiteral("Failed to create DConfig instance.");
+ worker->deleteLater();
+ return;
+ }
+ config->moveToThread(QThread::currentThread());
+ initialize(config);
+ worker->deleteLater();
+ });
+ }
+ explicit dconf-example_meta(QThread *thread, DTK_CORE_NAMESPACE::DConfigBackend *backend, const QString &name, const QString &subpath, QObject *parent = nullptr)
+ : QObject(parent) {
+
+ if (!thread->isRunning()) {
+ qWarning() << QStringLiteral("Warning: The provided thread is not running.");
+ }
+ Q_ASSERT(QThread::currentThread() != thread);
+ auto worker = new QObject();
+ worker->moveToThread(thread);
+ QMetaObject::invokeMethod(worker, [=]() {
+ auto config = DTK_CORE_NAMESPACE::DConfig::create(backend, name, subpath, nullptr);
+ if (!config) {
+ qWarning() << QStringLiteral("Failed to create DConfig instance.");
+ worker->deleteLater();
+ return;
+ }
+ config->moveToThread(QThread::currentThread());
+ initialize(config);
+ worker->deleteLater();
+ });
+ }
+ ~dconf-example_meta() {
+ if (m_config.loadRelaxed()) {
+ m_config.loadRelaxed()->deleteLater();
+ }
+ }
+
+ QList<QVariant> array() const {
+ return p_array;
+ }
+ void setArray(const QList<QVariant> &value) {
+ auto oldValue = p_array;
+ p_array = value;
+ markPropertySet(0);
+ if (auto config = m_config.loadRelaxed()) {
+ QMetaObject::invokeMethod(config, [this, value]() {
+ m_config.loadRelaxed()->setValue(QStringLiteral("array"), value);
+ });
+ }
+ if (p_array != oldValue) {
+ Q_EMIT arrayChanged();
+ }
+ }
+ QList<QVariant> array_map() const {
+ return p_array_map;
+ }
+ void setArray_map(const QList<QVariant> &value) {
+ auto oldValue = p_array_map;
+ p_array_map = value;
+ markPropertySet(1);
+ if (auto config = m_config.loadRelaxed()) {
+ QMetaObject::invokeMethod(config, [this, value]() {
+ m_config.loadRelaxed()->setValue(QStringLiteral("array_map"), value);
+ });
+ }
+ if (p_array_map != oldValue) {
+ Q_EMIT array_mapChanged();
+ }
+ }
+ QList<QVariant> array_map_struct() const {
+ return p_array_map_struct;
+ }
+ void setArray_map_struct(const QList<QVariant> &value) {
+ auto oldValue = p_array_map_struct;
+ p_array_map_struct = value;
+ markPropertySet(2);
+ if (auto config = m_config.loadRelaxed()) {
+ QMetaObject::invokeMethod(config, [this, value]() {
+ m_config.loadRelaxed()->setValue(QStringLiteral("array_map_struct"), value);
+ });
+ }
+ if (p_array_map_struct != oldValue) {
+ Q_EMIT array_map_structChanged();
+ }
+ }
+ bool canExit() const {
+ return p_canExit;
+ }
+ void setCanExit(const bool &value) {
+ auto oldValue = p_canExit;
+ p_canExit = value;
+ markPropertySet(3);
+ if (auto config = m_config.loadRelaxed()) {
+ QMetaObject::invokeMethod(config, [this, value]() {
+ m_config.loadRelaxed()->setValue(QStringLiteral("canExit"), value);
+ });
+ }
+ if (p_canExit != oldValue) {
+ Q_EMIT canExitChanged();
+ }
+ }
+ QString key2() const {
+ return p_key2;
+ }
+ void setKey2(const QString &value) {
+ auto oldValue = p_key2;
+ p_key2 = value;
+ markPropertySet(4);
+ if (auto config = m_config.loadRelaxed()) {
+ QMetaObject::invokeMethod(config, [this, value]() {
+ m_config.loadRelaxed()->setValue(QStringLiteral("key2"), value);
+ });
+ }
+ if (p_key2 != oldValue) {
+ Q_EMIT key2Changed();
+ }
+ }
+ QString key3() const {
+ return p_key3;
+ }
+ void setKey3(const QString &value) {
+ auto oldValue = p_key3;
+ p_key3 = value;
+ markPropertySet(5);
+ if (auto config = m_config.loadRelaxed()) {
+ QMetaObject::invokeMethod(config, [this, value]() {
+ m_config.loadRelaxed()->setValue(QStringLiteral("key3"), value);
+ });
+ }
+ if (p_key3 != oldValue) {
+ Q_EMIT key3Changed();
+ }
+ }
+ QVariantMap map() const {
+ return p_map;
+ }
+ void setMap(const QVariantMap &value) {
+ auto oldValue = p_map;
+ p_map = value;
+ markPropertySet(6);
+ if (auto config = m_config.loadRelaxed()) {
+ QMetaObject::invokeMethod(config, [this, value]() {
+ m_config.loadRelaxed()->setValue(QStringLiteral("map"), value);
+ });
+ }
+ if (p_map != oldValue) {
+ Q_EMIT mapChanged();
+ }
+ }
+ QVariantMap map_array() const {
+ return p_map_array;
+ }
+ void setMap_array(const QVariantMap &value) {
+ auto oldValue = p_map_array;
+ p_map_array = value;
+ markPropertySet(7);
+ if (auto config = m_config.loadRelaxed()) {
+ QMetaObject::invokeMethod(config, [this, value]() {
+ m_config.loadRelaxed()->setValue(QStringLiteral("map_array"), value);
+ });
+ }
+ if (p_map_array != oldValue) {
+ Q_EMIT map_arrayChanged();
+ }
+ }
+ double number() const {
+ return p_number;
+ }
+ void setNumber(const double &value) {
+ auto oldValue = p_number;
+ p_number = value;
+ markPropertySet(8);
+ if (auto config = m_config.loadRelaxed()) {
+ QMetaObject::invokeMethod(config, [this, value]() {
+ m_config.loadRelaxed()->setValue(QStringLiteral("number"), value);
+ });
+ }
+ if (p_number != oldValue) {
+ Q_EMIT numberChanged();
+ }
+ }
+ double numberDouble() const {
+ return p_numberDouble;
+ }
+ void setNumberDouble(const double &value) {
+ auto oldValue = p_numberDouble;
+ p_numberDouble = value;
+ markPropertySet(9);
+ if (auto config = m_config.loadRelaxed()) {
+ QMetaObject::invokeMethod(config, [this, value]() {
+ m_config.loadRelaxed()->setValue(QStringLiteral("numberDouble"), value);
+ });
+ }
+ if (p_numberDouble != oldValue) {
+ Q_EMIT numberDoubleChanged();
+ }
+ }
+ bool publicConfig() const {
+ return p_publicConfig;
+ }
+ void setPublicConfig(const bool &value) {
+ auto oldValue = p_publicConfig;
+ p_publicConfig = value;
+ markPropertySet(10);
+ if (auto config = m_config.loadRelaxed()) {
+ QMetaObject::invokeMethod(config, [this, value]() {
+ m_config.loadRelaxed()->setValue(QStringLiteral("publicConfig"), value);
+ });
+ }
+ if (p_publicConfig != oldValue) {
+ Q_EMIT publicConfigChanged();
+ }
+ }
+ QVariantMap struct() const {
+ return p_struct;
+ }
+ void setStruct(const QVariantMap &value) {
+ auto oldValue = p_struct;
+ p_struct = value;
+ markPropertySet(11);
+ if (auto config = m_config.loadRelaxed()) {
+ QMetaObject::invokeMethod(config, [this, value]() {
+ m_config.loadRelaxed()->setValue(QStringLiteral("struct"), value);
+ });
+ }
+ if (p_struct != oldValue) {
+ Q_EMIT structChanged();
+ }
+ }
+Q_SIGNALS:
+ void arrayChanged();
+ void array_mapChanged();
+ void array_map_structChanged();
+ void canExitChanged();
+ void key2Changed();
+ void key3Changed();
+ void mapChanged();
+ void map_arrayChanged();
+ void numberChanged();
+ void numberDoubleChanged();
+ void publicConfigChanged();
+ void structChanged();
+private:
+ void initialize(DTK_CORE_NAMESPACE::DConfig *config) {
+ Q_ASSERT(!m_config.loadRelaxed());
+ m_config.storeRelaxed(config);
+ if (testPropertySet(0)) {
+ config->setValue(QStringLiteral("array"), QVariant::fromValue(p_array));
+ } else {
+ updateValue(QStringLiteral("array"), QVariant::fromValue(p_array));
+ }
+ if (testPropertySet(1)) {
+ config->setValue(QStringLiteral("array_map"), QVariant::fromValue(p_array_map));
+ } else {
+ updateValue(QStringLiteral("array_map"), QVariant::fromValue(p_array_map));
+ }
+ if (testPropertySet(2)) {
+ config->setValue(QStringLiteral("array_map_struct"), QVariant::fromValue(p_array_map_struct));
+ } else {
+ updateValue(QStringLiteral("array_map_struct"), QVariant::fromValue(p_array_map_struct));
+ }
+ if (testPropertySet(3)) {
+ config->setValue(QStringLiteral("canExit"), QVariant::fromValue(p_canExit));
+ } else {
+ updateValue(QStringLiteral("canExit"), QVariant::fromValue(p_canExit));
+ }
+ if (testPropertySet(4)) {
+ config->setValue(QStringLiteral("key2"), QVariant::fromValue(p_key2));
+ } else {
+ updateValue(QStringLiteral("key2"), QVariant::fromValue(p_key2));
+ }
+ if (testPropertySet(5)) {
+ config->setValue(QStringLiteral("key3"), QVariant::fromValue(p_key3));
+ } else {
+ updateValue(QStringLiteral("key3"), QVariant::fromValue(p_key3));
+ }
+ if (testPropertySet(6)) {
+ config->setValue(QStringLiteral("map"), QVariant::fromValue(p_map));
+ } else {
+ updateValue(QStringLiteral("map"), QVariant::fromValue(p_map));
+ }
+ if (testPropertySet(7)) {
+ config->setValue(QStringLiteral("map_array"), QVariant::fromValue(p_map_array));
+ } else {
+ updateValue(QStringLiteral("map_array"), QVariant::fromValue(p_map_array));
+ }
+ if (testPropertySet(8)) {
+ config->setValue(QStringLiteral("number"), QVariant::fromValue(p_number));
+ } else {
+ updateValue(QStringLiteral("number"), QVariant::fromValue(p_number));
+ }
+ if (testPropertySet(9)) {
+ config->setValue(QStringLiteral("numberDouble"), QVariant::fromValue(p_numberDouble));
+ } else {
+ updateValue(QStringLiteral("numberDouble"), QVariant::fromValue(p_numberDouble));
+ }
+ if (testPropertySet(10)) {
+ config->setValue(QStringLiteral("publicConfig"), QVariant::fromValue(p_publicConfig));
+ } else {
+ updateValue(QStringLiteral("publicConfig"), QVariant::fromValue(p_publicConfig));
+ }
+ if (testPropertySet(11)) {
+ config->setValue(QStringLiteral("struct"), QVariant::fromValue(p_struct));
+ } else {
+ updateValue(QStringLiteral("struct"), QVariant::fromValue(p_struct));
+ }
+
+ connect(config, &DTK_CORE_NAMESPACE::DConfig::valueChanged, this, [this](const QString &key) {
+ updateValue(key);
+ }, Qt::DirectConnection);
+ }
+ void updateValue(const QString &key, const QVariant &fallback = QVariant()) {
+ Q_ASSERT(QThread::currentThread() == m_config.loadRelaxed()->thread());
+ const QVariant &value = m_config.loadRelaxed()->value(key, fallback);
+ if (key == QStringLiteral("array")) {
+ auto newValue = qvariant_cast<QList<QVariant>>(value);
+ QMetaObject::invokeMethod(this, [this, newValue]() {
+ if (p_array != newValue) {
+ p_array = newValue;
+ Q_EMIT arrayChanged();
+ }
+ });
+ return;
+ }
+ if (key == QStringLiteral("array_map")) {
+ auto newValue = qvariant_cast<QList<QVariant>>(value);
+ QMetaObject::invokeMethod(this, [this, newValue]() {
+ if (p_array_map != newValue) {
+ p_array_map = newValue;
+ Q_EMIT array_mapChanged();
+ }
+ });
+ return;
+ }
+ if (key == QStringLiteral("array_map_struct")) {
+ auto newValue = qvariant_cast<QList<QVariant>>(value);
+ QMetaObject::invokeMethod(this, [this, newValue]() {
+ if (p_array_map_struct != newValue) {
+ p_array_map_struct = newValue;
+ Q_EMIT array_map_structChanged();
+ }
+ });
+ return;
+ }
+ if (key == QStringLiteral("canExit")) {
+ auto newValue = qvariant_cast<bool>(value);
+ QMetaObject::invokeMethod(this, [this, newValue]() {
+ if (p_canExit != newValue) {
+ p_canExit = newValue;
+ Q_EMIT canExitChanged();
+ }
+ });
+ return;
+ }
+ if (key == QStringLiteral("key2")) {
+ auto newValue = qvariant_cast<QString>(value);
+ QMetaObject::invokeMethod(this, [this, newValue]() {
+ if (p_key2 != newValue) {
+ p_key2 = newValue;
+ Q_EMIT key2Changed();
+ }
+ });
+ return;
+ }
+ if (key == QStringLiteral("key3")) {
+ auto newValue = qvariant_cast<QString>(value);
+ QMetaObject::invokeMethod(this, [this, newValue]() {
+ if (p_key3 != newValue) {
+ p_key3 = newValue;
+ Q_EMIT key3Changed();
+ }
+ });
+ return;
+ }
+ if (key == QStringLiteral("map")) {
+ auto newValue = qvariant_cast<QVariantMap>(value);
+ QMetaObject::invokeMethod(this, [this, newValue]() {
+ if (p_map != newValue) {
+ p_map = newValue;
+ Q_EMIT mapChanged();
+ }
+ });
+ return;
+ }
+ if (key == QStringLiteral("map_array")) {
+ auto newValue = qvariant_cast<QVariantMap>(value);
+ QMetaObject::invokeMethod(this, [this, newValue]() {
+ if (p_map_array != newValue) {
+ p_map_array = newValue;
+ Q_EMIT map_arrayChanged();
+ }
+ });
+ return;
+ }
+ if (key == QStringLiteral("number")) {
+ auto newValue = qvariant_cast<double>(value);
+ QMetaObject::invokeMethod(this, [this, newValue]() {
+ if (p_number != newValue) {
+ p_number = newValue;
+ Q_EMIT numberChanged();
+ }
+ });
+ return;
+ }
+ if (key == QStringLiteral("numberDouble")) {
+ auto newValue = qvariant_cast<double>(value);
+ QMetaObject::invokeMethod(this, [this, newValue]() {
+ if (p_numberDouble != newValue) {
+ p_numberDouble = newValue;
+ Q_EMIT numberDoubleChanged();
+ }
+ });
+ return;
+ }
+ if (key == QStringLiteral("publicConfig")) {
+ auto newValue = qvariant_cast<bool>(value);
+ QMetaObject::invokeMethod(this, [this, newValue]() {
+ if (p_publicConfig != newValue) {
+ p_publicConfig = newValue;
+ Q_EMIT publicConfigChanged();
+ }
+ });
+ return;
+ }
+ if (key == QStringLiteral("struct")) {
+ auto newValue = qvariant_cast<QVariantMap>(value);
+ QMetaObject::invokeMethod(this, [this, newValue]() {
+ if (p_struct != newValue) {
+ p_struct = newValue;
+ Q_EMIT structChanged();
+ }
+ });
+ return;
+ }
+ }
+ inline void markPropertySet(const int index) {
+ if (index < 32) {
+ m_propertySetStatus0.fetchAndOrOrdered(1 << (index - 0));
+ return;
+ }
+ Q_UNREACHABLE();
+ }
+ inline bool testPropertySet(const int index) const {
+ if (index < 32) {
+ return (m_propertySetStatus0.loadRelaxed() & (1 << (index - 0)));
+ }
+ Q_UNREACHABLE();
+ }
+ QAtomicPointer<DTK_CORE_NAMESPACE::DConfig> m_config = nullptr;
+ QList<QVariant> p_array { QList<QVariant>{QVariant(QStringLiteral("value1")), QVariant(QStringLiteral("value2"))} };
+ QList<QVariant> p_array_map { QList<QVariant>{QVariant(QVariantMap{{QStringLiteral("key1"), QVariant(QStringLiteral("value1"))}, {QStringLiteral("key2"), QVariant(QStringLiteral("value2"))}})} };
+ QList<QVariant> p_array_map_struct { QList<QVariant>{QVariant(QVariantMap{{QStringLiteral("key1"), QVariant(QVariantMap{{QStringLiteral("field1"), QVariant(QStringLiteral("value1"))}})}, {QStringLiteral("key2"), QVariant(QStringLiteral("value2"))}})} };
+ bool p_canExit { true };
+ QString p_key2 { QStringLiteral("125") };
+ QString p_key3 { QStringLiteral("application") };
+ QVariantMap p_map { QVariantMap{{QStringLiteral("key1"), QVariant(QStringLiteral("value1"))}, {QStringLiteral("key2"), QVariant(QStringLiteral("value2"))}} };
+ QVariantMap p_map_array { QVariantMap{{QStringLiteral("key1"), QVariant(QList<QVariant>{QVariant(QStringLiteral("value1"))})}, {QStringLiteral("key2"), QVariant(QList<QVariant>{QVariant(QStringLiteral("value2"))})}} };
+ double p_number { 1 };
+ double p_numberDouble { 1 };
+ bool p_publicConfig { true };
+ QVariantMap p_struct { QVariantMap{{QStringLiteral("key1"), QVariant(QStringLiteral("value1"))}, {QStringLiteral("key2"), QVariant(QStringLiteral("value2"))}} };
+ QAtomicInteger<quint32> m_propertySetStatus0 = 0;
+};
+
+#endif // DCONF-EXAMPLE_META_H
--- /dev/null
+/**
+ * This file is generated by dconfig2cpp.
+ * Command line arguments: ./dconfig2cpp -p ./dtkcore/toolGenerate/dconfig2cpp ./dtkcore/tests/data/dconf-example_other_app_configure.meta.json
+ * Generation time: 2025-01-14T10:54:59
+ * JSON file version: 1.0
+ *
+ * WARNING: DO NOT MODIFY THIS FILE MANUALLY.
+ * If you need to change the content, please modify the dconfig2cpp tool.
+ */
+
+#ifndef DCONF-EXAMPLE_OTHER_APP_CONFIGURE_META_H
+#define DCONF-EXAMPLE_OTHER_APP_CONFIGURE_META_H
+
+#include <QThread>
+#include <QVariant>
+#include <QDebug>
+#include <QAtomicPointer>
+#include <QAtomicInteger>
+#include <DConfig>
+
+class dconf-example_other_app_configure_meta : public QObject {
+ Q_OBJECT
+
+ Q_PROPERTY(QString appPrivate READ appPrivate WRITE setAppPrivate NOTIFY appPrivateChanged)
+ Q_PROPERTY(QString appPublic READ appPublic WRITE setAppPublic NOTIFY appPublicChanged)
+public:
+ explicit dconf-example_other_app_configure_meta(QThread *thread, const QString &appId, const QString &name, const QString &subpath, QObject *parent = nullptr)
+ : QObject(parent) {
+
+ if (!thread->isRunning()) {
+ qWarning() << QStringLiteral("Warning: The provided thread is not running.");
+ }
+ Q_ASSERT(QThread::currentThread() != thread);
+ auto worker = new QObject();
+ worker->moveToThread(thread);
+ QMetaObject::invokeMethod(worker, [=]() {
+ auto config = DTK_CORE_NAMESPACE::DConfig::create(appId, name, subpath, nullptr);
+ if (!config) {
+ qWarning() << QStringLiteral("Failed to create DConfig instance.");
+ worker->deleteLater();
+ return;
+ }
+ config->moveToThread(QThread::currentThread());
+ initialize(config);
+ worker->deleteLater();
+ });
+ }
+ explicit dconf-example_other_app_configure_meta(QThread *thread, DTK_CORE_NAMESPACE::DConfigBackend *backend, const QString &appId, const QString &name, const QString &subpath, QObject *parent = nullptr)
+ : QObject(parent) {
+
+ if (!thread->isRunning()) {
+ qWarning() << QStringLiteral("Warning: The provided thread is not running.");
+ }
+ Q_ASSERT(QThread::currentThread() != thread);
+ auto worker = new QObject();
+ worker->moveToThread(thread);
+ QMetaObject::invokeMethod(worker, [=]() {
+ auto config = DTK_CORE_NAMESPACE::DConfig::create(backend, appId, name, subpath, nullptr);
+ if (!config) {
+ qWarning() << QStringLiteral("Failed to create DConfig instance.");
+ worker->deleteLater();
+ return;
+ }
+ config->moveToThread(QThread::currentThread());
+ initialize(config);
+ worker->deleteLater();
+ });
+ }
+ explicit dconf-example_other_app_configure_meta(QThread *thread, const QString &name, const QString &subpath, QObject *parent = nullptr)
+ : QObject(parent) {
+
+ if (!thread->isRunning()) {
+ qWarning() << QStringLiteral("Warning: The provided thread is not running.");
+ }
+ Q_ASSERT(QThread::currentThread() != thread);
+ auto worker = new QObject();
+ worker->moveToThread(thread);
+ QMetaObject::invokeMethod(worker, [=]() {
+ auto config = DTK_CORE_NAMESPACE::DConfig::create(name, subpath, nullptr);
+ if (!config) {
+ qWarning() << QStringLiteral("Failed to create DConfig instance.");
+ worker->deleteLater();
+ return;
+ }
+ config->moveToThread(QThread::currentThread());
+ initialize(config);
+ worker->deleteLater();
+ });
+ }
+ explicit dconf-example_other_app_configure_meta(QThread *thread, DTK_CORE_NAMESPACE::DConfigBackend *backend, const QString &name, const QString &subpath, QObject *parent = nullptr)
+ : QObject(parent) {
+
+ if (!thread->isRunning()) {
+ qWarning() << QStringLiteral("Warning: The provided thread is not running.");
+ }
+ Q_ASSERT(QThread::currentThread() != thread);
+ auto worker = new QObject();
+ worker->moveToThread(thread);
+ QMetaObject::invokeMethod(worker, [=]() {
+ auto config = DTK_CORE_NAMESPACE::DConfig::create(backend, name, subpath, nullptr);
+ if (!config) {
+ qWarning() << QStringLiteral("Failed to create DConfig instance.");
+ worker->deleteLater();
+ return;
+ }
+ config->moveToThread(QThread::currentThread());
+ initialize(config);
+ worker->deleteLater();
+ });
+ }
+ ~dconf-example_other_app_configure_meta() {
+ if (m_config.loadRelaxed()) {
+ m_config.loadRelaxed()->deleteLater();
+ }
+ }
+
+ QString appPrivate() const {
+ return p_appPrivate;
+ }
+ void setAppPrivate(const QString &value) {
+ auto oldValue = p_appPrivate;
+ p_appPrivate = value;
+ markPropertySet(0);
+ if (auto config = m_config.loadRelaxed()) {
+ QMetaObject::invokeMethod(config, [this, value]() {
+ m_config.loadRelaxed()->setValue(QStringLiteral("appPrivate"), value);
+ });
+ }
+ if (p_appPrivate != oldValue) {
+ Q_EMIT appPrivateChanged();
+ }
+ }
+ QString appPublic() const {
+ return p_appPublic;
+ }
+ void setAppPublic(const QString &value) {
+ auto oldValue = p_appPublic;
+ p_appPublic = value;
+ markPropertySet(1);
+ if (auto config = m_config.loadRelaxed()) {
+ QMetaObject::invokeMethod(config, [this, value]() {
+ m_config.loadRelaxed()->setValue(QStringLiteral("appPublic"), value);
+ });
+ }
+ if (p_appPublic != oldValue) {
+ Q_EMIT appPublicChanged();
+ }
+ }
+Q_SIGNALS:
+ void appPrivateChanged();
+ void appPublicChanged();
+private:
+ void initialize(DTK_CORE_NAMESPACE::DConfig *config) {
+ Q_ASSERT(!m_config.loadRelaxed());
+ m_config.storeRelaxed(config);
+ if (testPropertySet(0)) {
+ config->setValue(QStringLiteral("appPrivate"), QVariant::fromValue(p_appPrivate));
+ } else {
+ updateValue(QStringLiteral("appPrivate"), QVariant::fromValue(p_appPrivate));
+ }
+ if (testPropertySet(1)) {
+ config->setValue(QStringLiteral("appPublic"), QVariant::fromValue(p_appPublic));
+ } else {
+ updateValue(QStringLiteral("appPublic"), QVariant::fromValue(p_appPublic));
+ }
+
+ connect(config, &DTK_CORE_NAMESPACE::DConfig::valueChanged, this, [this](const QString &key) {
+ updateValue(key);
+ }, Qt::DirectConnection);
+ }
+ void updateValue(const QString &key, const QVariant &fallback = QVariant()) {
+ Q_ASSERT(QThread::currentThread() == m_config.loadRelaxed()->thread());
+ const QVariant &value = m_config.loadRelaxed()->value(key, fallback);
+ if (key == QStringLiteral("appPrivate")) {
+ auto newValue = qvariant_cast<QString>(value);
+ QMetaObject::invokeMethod(this, [this, newValue]() {
+ if (p_appPrivate != newValue) {
+ p_appPrivate = newValue;
+ Q_EMIT appPrivateChanged();
+ }
+ });
+ return;
+ }
+ if (key == QStringLiteral("appPublic")) {
+ auto newValue = qvariant_cast<QString>(value);
+ QMetaObject::invokeMethod(this, [this, newValue]() {
+ if (p_appPublic != newValue) {
+ p_appPublic = newValue;
+ Q_EMIT appPublicChanged();
+ }
+ });
+ return;
+ }
+ }
+ inline void markPropertySet(const int index) {
+ if (index < 32) {
+ m_propertySetStatus0.fetchAndOrOrdered(1 << (index - 0));
+ return;
+ }
+ Q_UNREACHABLE();
+ }
+ inline bool testPropertySet(const int index) const {
+ if (index < 32) {
+ return (m_propertySetStatus0.loadRelaxed() & (1 << (index - 0)));
+ }
+ Q_UNREACHABLE();
+ }
+ QAtomicPointer<DTK_CORE_NAMESPACE::DConfig> m_config = nullptr;
+ QString p_appPrivate { QStringLiteral("appPrivate") };
+ QString p_appPublic { QStringLiteral("publicValue") };
+ QAtomicInteger<quint32> m_propertySetStatus0 = 0;
+};
+
+#endif // DCONF-EXAMPLE_OTHER_APP_CONFIGURE_META_H
--- /dev/null
+/**
+ * This file is generated by dconfig2cpp.
+ * Command line arguments: ./dconfig2cpp -p ./dtkcore/toolGenerate/dconfig2cpp ./dtkcore/tests/data/dconf-global.meta.json
+ * Generation time: 2025-01-14T10:54:59
+ * JSON file version: 1.0
+ *
+ * WARNING: DO NOT MODIFY THIS FILE MANUALLY.
+ * If you need to change the content, please modify the dconfig2cpp tool.
+ */
+
+#ifndef DCONF-GLOBAL_META_H
+#define DCONF-GLOBAL_META_H
+
+#include <QThread>
+#include <QVariant>
+#include <QDebug>
+#include <QAtomicPointer>
+#include <QAtomicInteger>
+#include <DConfig>
+
+class dconf-global_meta : public QObject {
+ Q_OBJECT
+
+ Q_PROPERTY(QString key3 READ key3 WRITE setKey3 NOTIFY key3Changed)
+public:
+ explicit dconf-global_meta(QThread *thread, const QString &appId, const QString &name, const QString &subpath, QObject *parent = nullptr)
+ : QObject(parent) {
+
+ if (!thread->isRunning()) {
+ qWarning() << QStringLiteral("Warning: The provided thread is not running.");
+ }
+ Q_ASSERT(QThread::currentThread() != thread);
+ auto worker = new QObject();
+ worker->moveToThread(thread);
+ QMetaObject::invokeMethod(worker, [=]() {
+ auto config = DTK_CORE_NAMESPACE::DConfig::create(appId, name, subpath, nullptr);
+ if (!config) {
+ qWarning() << QStringLiteral("Failed to create DConfig instance.");
+ worker->deleteLater();
+ return;
+ }
+ config->moveToThread(QThread::currentThread());
+ initialize(config);
+ worker->deleteLater();
+ });
+ }
+ explicit dconf-global_meta(QThread *thread, DTK_CORE_NAMESPACE::DConfigBackend *backend, const QString &appId, const QString &name, const QString &subpath, QObject *parent = nullptr)
+ : QObject(parent) {
+
+ if (!thread->isRunning()) {
+ qWarning() << QStringLiteral("Warning: The provided thread is not running.");
+ }
+ Q_ASSERT(QThread::currentThread() != thread);
+ auto worker = new QObject();
+ worker->moveToThread(thread);
+ QMetaObject::invokeMethod(worker, [=]() {
+ auto config = DTK_CORE_NAMESPACE::DConfig::create(backend, appId, name, subpath, nullptr);
+ if (!config) {
+ qWarning() << QStringLiteral("Failed to create DConfig instance.");
+ worker->deleteLater();
+ return;
+ }
+ config->moveToThread(QThread::currentThread());
+ initialize(config);
+ worker->deleteLater();
+ });
+ }
+ explicit dconf-global_meta(QThread *thread, const QString &name, const QString &subpath, QObject *parent = nullptr)
+ : QObject(parent) {
+
+ if (!thread->isRunning()) {
+ qWarning() << QStringLiteral("Warning: The provided thread is not running.");
+ }
+ Q_ASSERT(QThread::currentThread() != thread);
+ auto worker = new QObject();
+ worker->moveToThread(thread);
+ QMetaObject::invokeMethod(worker, [=]() {
+ auto config = DTK_CORE_NAMESPACE::DConfig::create(name, subpath, nullptr);
+ if (!config) {
+ qWarning() << QStringLiteral("Failed to create DConfig instance.");
+ worker->deleteLater();
+ return;
+ }
+ config->moveToThread(QThread::currentThread());
+ initialize(config);
+ worker->deleteLater();
+ });
+ }
+ explicit dconf-global_meta(QThread *thread, DTK_CORE_NAMESPACE::DConfigBackend *backend, const QString &name, const QString &subpath, QObject *parent = nullptr)
+ : QObject(parent) {
+
+ if (!thread->isRunning()) {
+ qWarning() << QStringLiteral("Warning: The provided thread is not running.");
+ }
+ Q_ASSERT(QThread::currentThread() != thread);
+ auto worker = new QObject();
+ worker->moveToThread(thread);
+ QMetaObject::invokeMethod(worker, [=]() {
+ auto config = DTK_CORE_NAMESPACE::DConfig::create(backend, name, subpath, nullptr);
+ if (!config) {
+ qWarning() << QStringLiteral("Failed to create DConfig instance.");
+ worker->deleteLater();
+ return;
+ }
+ config->moveToThread(QThread::currentThread());
+ initialize(config);
+ worker->deleteLater();
+ });
+ }
+ ~dconf-global_meta() {
+ if (m_config.loadRelaxed()) {
+ m_config.loadRelaxed()->deleteLater();
+ }
+ }
+
+ QString key3() const {
+ return p_key3;
+ }
+ void setKey3(const QString &value) {
+ auto oldValue = p_key3;
+ p_key3 = value;
+ markPropertySet(0);
+ if (auto config = m_config.loadRelaxed()) {
+ QMetaObject::invokeMethod(config, [this, value]() {
+ m_config.loadRelaxed()->setValue(QStringLiteral("key3"), value);
+ });
+ }
+ if (p_key3 != oldValue) {
+ Q_EMIT key3Changed();
+ }
+ }
+Q_SIGNALS:
+ void key3Changed();
+private:
+ void initialize(DTK_CORE_NAMESPACE::DConfig *config) {
+ Q_ASSERT(!m_config.loadRelaxed());
+ m_config.storeRelaxed(config);
+ if (testPropertySet(0)) {
+ config->setValue(QStringLiteral("key3"), QVariant::fromValue(p_key3));
+ } else {
+ updateValue(QStringLiteral("key3"), QVariant::fromValue(p_key3));
+ }
+
+ connect(config, &DTK_CORE_NAMESPACE::DConfig::valueChanged, this, [this](const QString &key) {
+ updateValue(key);
+ }, Qt::DirectConnection);
+ }
+ void updateValue(const QString &key, const QVariant &fallback = QVariant()) {
+ Q_ASSERT(QThread::currentThread() == m_config.loadRelaxed()->thread());
+ const QVariant &value = m_config.loadRelaxed()->value(key, fallback);
+ if (key == QStringLiteral("key3")) {
+ auto newValue = qvariant_cast<QString>(value);
+ QMetaObject::invokeMethod(this, [this, newValue]() {
+ if (p_key3 != newValue) {
+ p_key3 = newValue;
+ Q_EMIT key3Changed();
+ }
+ });
+ return;
+ }
+ }
+ inline void markPropertySet(const int index) {
+ if (index < 32) {
+ m_propertySetStatus0.fetchAndOrOrdered(1 << (index - 0));
+ return;
+ }
+ Q_UNREACHABLE();
+ }
+ inline bool testPropertySet(const int index) const {
+ if (index < 32) {
+ return (m_propertySetStatus0.loadRelaxed() & (1 << (index - 0)));
+ }
+ Q_UNREACHABLE();
+ }
+ QAtomicPointer<DTK_CORE_NAMESPACE::DConfig> m_config = nullptr;
+ QString p_key3 { QStringLiteral("global") };
+ QAtomicInteger<quint32> m_propertySetStatus0 = 0;
+};
+
+#endif // DCONF-GLOBAL_META_H
--- /dev/null
+/*
+ * This file was generated by qdbusxml2cpp version 0.8
+ * Command line was: qdbusxml2cpp ./dtkcore/src/dbus/org.desktopspec.ConfigManager.Manager.xml -a ./dtkcore/toolGenerate/qdbusxml2cpp/org.desktopspec.ConfigManager.ManagerAdaptor -i ./dtkcore/toolGenerate/qdbusxml2cpp/org.desktopspec.ConfigManager.Manager.h
+ *
+ * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
+ *
+ * This is an auto-generated file.
+ * Do not edit! All changes made to it will be lost.
+ */
+
+#include "./dtkcore/toolGenerate/qdbusxml2cpp/org.desktopspec.ConfigManager.ManagerAdaptor.h"
+#include <QtCore/QMetaObject>
+#include <QtCore/QByteArray>
+#include <QtCore/QList>
+#include <QtCore/QMap>
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+#include <QtCore/QVariant>
+
+/*
+ * Implementation of adaptor class ManagerAdaptor
+ */
+
+ManagerAdaptor::ManagerAdaptor(QObject *parent)
+ : QDBusAbstractAdaptor(parent)
+{
+ // constructor
+ setAutoRelaySignals(true);
+}
+
+ManagerAdaptor::~ManagerAdaptor()
+{
+ // destructor
+}
+
+QStringList ManagerAdaptor::keyList() const
+{
+ // get the value of property keyList
+ return qvariant_cast< QStringList >(parent()->property("keyList"));
+}
+
+QString ManagerAdaptor::version() const
+{
+ // get the value of property version
+ return qvariant_cast< QString >(parent()->property("version"));
+}
+
+QString ManagerAdaptor::description(const QString &key, const QString &language)
+{
+ // handle method call org.desktopspec.ConfigManager.Manager.description
+ QString description;
+ QMetaObject::invokeMethod(parent(), "description", Q_RETURN_ARG(QString, description), Q_ARG(QString, key), Q_ARG(QString, language));
+ return description;
+}
+
+bool ManagerAdaptor::isDefaultValue(const QString &key)
+{
+ // handle method call org.desktopspec.ConfigManager.Manager.isDefaultValue
+ bool isDefaultValue;
+ QMetaObject::invokeMethod(parent(), "isDefaultValue", Q_RETURN_ARG(bool, isDefaultValue), Q_ARG(QString, key));
+ return isDefaultValue;
+}
+
+QString ManagerAdaptor::name(const QString &key, const QString &language)
+{
+ // handle method call org.desktopspec.ConfigManager.Manager.name
+ QString name;
+ QMetaObject::invokeMethod(parent(), "name", Q_RETURN_ARG(QString, name), Q_ARG(QString, key), Q_ARG(QString, language));
+ return name;
+}
+
+QString ManagerAdaptor::permissions(const QString &key)
+{
+ // handle method call org.desktopspec.ConfigManager.Manager.permissions
+ QString permissions;
+ QMetaObject::invokeMethod(parent(), "permissions", Q_RETURN_ARG(QString, permissions), Q_ARG(QString, key));
+ return permissions;
+}
+
+void ManagerAdaptor::release()
+{
+ // handle method call org.desktopspec.ConfigManager.Manager.release
+ QMetaObject::invokeMethod(parent(), "release");
+}
+
+void ManagerAdaptor::reset(const QString &key)
+{
+ // handle method call org.desktopspec.ConfigManager.Manager.reset
+ QMetaObject::invokeMethod(parent(), "reset", Q_ARG(QString, key));
+}
+
+void ManagerAdaptor::setValue(const QString &key, const QDBusVariant &value)
+{
+ // handle method call org.desktopspec.ConfigManager.Manager.setValue
+ QMetaObject::invokeMethod(parent(), "setValue", Q_ARG(QString, key), Q_ARG(QDBusVariant, value));
+}
+
+QDBusVariant ManagerAdaptor::value(const QString &key)
+{
+ // handle method call org.desktopspec.ConfigManager.Manager.value
+ QDBusVariant value;
+ QMetaObject::invokeMethod(parent(), "value", Q_RETURN_ARG(QDBusVariant, value), Q_ARG(QString, key));
+ return value;
+}
+
+QString ManagerAdaptor::visibility(const QString &key)
+{
+ // handle method call org.desktopspec.ConfigManager.Manager.visibility
+ QString visibility;
+ QMetaObject::invokeMethod(parent(), "visibility", Q_RETURN_ARG(QString, visibility), Q_ARG(QString, key));
+ return visibility;
+}
+
--- /dev/null
+/*
+ * This file was generated by qdbusxml2cpp version 0.8
+ * Command line was: qdbusxml2cpp ./dtkcore/src/dbus/org.desktopspec.ConfigManager.Manager.xml -a ./dtkcore/toolGenerate/qdbusxml2cpp/org.desktopspec.ConfigManager.ManagerAdaptor -i ./dtkcore/toolGenerate/qdbusxml2cpp/org.desktopspec.ConfigManager.Manager.h
+ *
+ * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
+ *
+ * This is an auto-generated file.
+ * This file may have been hand-edited. Look for HAND-EDIT comments
+ * before re-generating it.
+ */
+
+#ifndef ORG_DESKTOPSPEC_CONFIGMANAGER_MANAGERADAPTOR_H
+#define ORG_DESKTOPSPEC_CONFIGMANAGER_MANAGERADAPTOR_H
+
+#include <QtCore/QObject>
+#include <QtDBus/QtDBus>
+#include "./dtkcore/toolGenerate/qdbusxml2cpp/org.desktopspec.ConfigManager.Manager.h"
+QT_BEGIN_NAMESPACE
+class QByteArray;
+template<class T> class QList;
+template<class Key, class Value> class QMap;
+class QString;
+class QStringList;
+class QVariant;
+QT_END_NAMESPACE
+
+/*
+ * Adaptor class for interface org.desktopspec.ConfigManager.Manager
+ */
+class ManagerAdaptor: public QDBusAbstractAdaptor
+{
+ Q_OBJECT
+ Q_CLASSINFO("D-Bus Interface", "org.desktopspec.ConfigManager.Manager")
+ Q_CLASSINFO("D-Bus Introspection", ""
+" <interface name=\"org.desktopspec.ConfigManager.Manager\">\n"
+" <property access=\"read\" type=\"s\" name=\"version\"/>\n"
+" <property access=\"read\" type=\"as\" name=\"keyList\"/>\n"
+" <method name=\"value\">\n"
+" <arg direction=\"in\" type=\"s\" name=\"key\"/>\n"
+" <arg direction=\"out\" type=\"v\" name=\"value\"/>\n"
+" </method>\n"
+" <method name=\"isDefaultValue\">\n"
+" <arg direction=\"in\" type=\"s\" name=\"key\"/>\n"
+" <arg direction=\"out\" type=\"b\" name=\"isDefaultValue\"/>\n"
+" </method>\n"
+" <method name=\"setValue\">\n"
+" <arg direction=\"in\" type=\"s\" name=\"key\"/>\n"
+" <arg direction=\"in\" type=\"v\" name=\"value\"/>\n"
+" </method>\n"
+" <method name=\"reset\">\n"
+" <arg direction=\"in\" type=\"s\" name=\"key\"/>\n"
+" </method>\n"
+" <method name=\"name\">\n"
+" <arg direction=\"in\" type=\"s\" name=\"key\"/>\n"
+" <arg direction=\"in\" type=\"s\" name=\"language\"/>\n"
+" <arg direction=\"out\" type=\"s\" name=\"name\"/>\n"
+" </method>\n"
+" <method name=\"description\">\n"
+" <arg direction=\"in\" type=\"s\" name=\"key\"/>\n"
+" <arg direction=\"in\" type=\"s\" name=\"language\"/>\n"
+" <arg direction=\"out\" type=\"s\" name=\"description\"/>\n"
+" </method>\n"
+" <method name=\"visibility\">\n"
+" <arg direction=\"in\" type=\"s\" name=\"key\"/>\n"
+" <arg direction=\"out\" type=\"s\" name=\"visibility\"/>\n"
+" </method>\n"
+" <method name=\"permissions\">\n"
+" <arg direction=\"in\" type=\"s\" name=\"key\"/>\n"
+" <arg direction=\"out\" type=\"s\" name=\"permissions\"/>\n"
+" </method>\n"
+" <method name=\"release\"/>\n"
+" <signal name=\"valueChanged\">\n"
+" <arg direction=\"out\" type=\"s\" name=\"key\"/>\n"
+" </signal>\n"
+" </interface>\n"
+ "")
+public:
+ ManagerAdaptor(QObject *parent);
+ virtual ~ManagerAdaptor();
+
+public: // PROPERTIES
+ Q_PROPERTY(QStringList keyList READ keyList)
+ QStringList keyList() const;
+
+ Q_PROPERTY(QString version READ version)
+ QString version() const;
+
+public Q_SLOTS: // METHODS
+ QString description(const QString &key, const QString &language);
+ bool isDefaultValue(const QString &key);
+ QString name(const QString &key, const QString &language);
+ QString permissions(const QString &key);
+ void release();
+ void reset(const QString &key);
+ void setValue(const QString &key, const QDBusVariant &value);
+ QDBusVariant value(const QString &key);
+ QString visibility(const QString &key);
+Q_SIGNALS: // SIGNALS
+ void valueChanged(const QString &key);
+};
+
+#endif
--- /dev/null
+/*
+ * This file was generated by qdbusxml2cpp version 0.8
+ * Command line was: qdbusxml2cpp ./dtkcore/src/dbus/org.desktopspec.ConfigManager.xml -a ./dtkcore/toolGenerate/qdbusxml2cpp/org.desktopspec.ConfigManagerAdaptor -i ./dtkcore/toolGenerate/qdbusxml2cpp/org.desktopspec.ConfigManager.h
+ *
+ * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
+ *
+ * This is an auto-generated file.
+ * Do not edit! All changes made to it will be lost.
+ */
+
+#include "./dtkcore/toolGenerate/qdbusxml2cpp/org.desktopspec.ConfigManagerAdaptor.h"
+#include <QtCore/QMetaObject>
+#include <QtCore/QByteArray>
+#include <QtCore/QList>
+#include <QtCore/QMap>
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+#include <QtCore/QVariant>
+
+/*
+ * Implementation of adaptor class ConfigManagerAdaptor
+ */
+
+ConfigManagerAdaptor::ConfigManagerAdaptor(QObject *parent)
+ : QDBusAbstractAdaptor(parent)
+{
+ // constructor
+ setAutoRelaySignals(true);
+}
+
+ConfigManagerAdaptor::~ConfigManagerAdaptor()
+{
+ // destructor
+}
+
+QDBusObjectPath ConfigManagerAdaptor::acquireManager(const QString &appid, const QString &name, const QString &subpath)
+{
+ // handle method call org.desktopspec.ConfigManager.acquireManager
+ QDBusObjectPath path;
+ QMetaObject::invokeMethod(parent(), "acquireManager", Q_RETURN_ARG(QDBusObjectPath, path), Q_ARG(QString, appid), Q_ARG(QString, name), Q_ARG(QString, subpath));
+ return path;
+}
+
+void ConfigManagerAdaptor::sync(const QString &path)
+{
+ // handle method call org.desktopspec.ConfigManager.sync
+ QMetaObject::invokeMethod(parent(), "sync", Q_ARG(QString, path));
+}
+
+void ConfigManagerAdaptor::update(const QString &path)
+{
+ // handle method call org.desktopspec.ConfigManager.update
+ QMetaObject::invokeMethod(parent(), "update", Q_ARG(QString, path));
+}
+
--- /dev/null
+/*
+ * This file was generated by qdbusxml2cpp version 0.8
+ * Command line was: qdbusxml2cpp ./dtkcore/src/dbus/org.desktopspec.ConfigManager.xml -a ./dtkcore/toolGenerate/qdbusxml2cpp/org.desktopspec.ConfigManagerAdaptor -i ./dtkcore/toolGenerate/qdbusxml2cpp/org.desktopspec.ConfigManager.h
+ *
+ * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
+ *
+ * This is an auto-generated file.
+ * This file may have been hand-edited. Look for HAND-EDIT comments
+ * before re-generating it.
+ */
+
+#ifndef ORG_DESKTOPSPEC_CONFIGMANAGERADAPTOR_H
+#define ORG_DESKTOPSPEC_CONFIGMANAGERADAPTOR_H
+
+#include <QtCore/QObject>
+#include <QtDBus/QtDBus>
+#include "./dtkcore/toolGenerate/qdbusxml2cpp/org.desktopspec.ConfigManager.h"
+QT_BEGIN_NAMESPACE
+class QByteArray;
+template<class T> class QList;
+template<class Key, class Value> class QMap;
+class QString;
+class QStringList;
+class QVariant;
+QT_END_NAMESPACE
+
+/*
+ * Adaptor class for interface org.desktopspec.ConfigManager
+ */
+class ConfigManagerAdaptor: public QDBusAbstractAdaptor
+{
+ Q_OBJECT
+ Q_CLASSINFO("D-Bus Interface", "org.desktopspec.ConfigManager")
+ Q_CLASSINFO("D-Bus Introspection", ""
+" <interface name=\"org.desktopspec.ConfigManager\">\n"
+" <method name=\"acquireManager\">\n"
+" <arg direction=\"in\" type=\"s\" name=\"appid\"/>\n"
+" <arg direction=\"in\" type=\"s\" name=\"name\"/>\n"
+" <arg direction=\"in\" type=\"s\" name=\"subpath\"/>\n"
+" <arg direction=\"out\" type=\"o\" name=\"path\"/>\n"
+" </method>\n"
+" <method name=\"update\">\n"
+" <arg direction=\"in\" type=\"s\" name=\"path\"/>\n"
+" </method>\n"
+" <method name=\"sync\">\n"
+" <arg direction=\"in\" type=\"s\" name=\"path\"/>\n"
+" </method>\n"
+" </interface>\n"
+ "")
+public:
+ ConfigManagerAdaptor(QObject *parent);
+ virtual ~ConfigManagerAdaptor();
+
+public: // PROPERTIES
+public Q_SLOTS: // METHODS
+ QDBusObjectPath acquireManager(const QString &appid, const QString &name, const QString &subpath);
+ void sync(const QString &path);
+ void update(const QString &path);
+Q_SIGNALS: // SIGNALS
+};
+
+#endif
QLatin1String("sourceFile"));
parser.addOption(sourceFileOption);
- QCommandLineOption cppPropertyOption(QStringList() << QLatin1String("use-qproperty"),
- QLatin1String("Generate Qt/C++ properties use QProperty"));
- parser.addOption(cppPropertyOption);
-
QCommandLineOption forceRequestThread(QStringList() << QLatin1String("force-request-thread"),
QLatin1String("Force request thread to create DConfig instance"));
parser.addOption(forceRequestThread);
headerStream << "#include <QDebug>\n";
headerStream << "#include <QAtomicPointer>\n";
headerStream << "#include <QAtomicInteger>\n";
-
- if (parser.isSet(cppPropertyOption)) {
- headerStream << "#include <QProperty>\n";
- }
+ headerStream << "#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)\n"
+ << "#include <QProperty>\n"
+ << "#endif\n";
headerStream << "#include <DConfig>\n\n";
headerStream << "class " << className << " : public QObject {\n";
typeName,
propertyName,
capitalizedPropertyName,
- "QStringLiteral(u\"" + toUnicodeEscape(propertyName) + "\")",
+ "QStringLiteral(\"" + propertyName + "\")",
obj[QLatin1String("value")]
}));
propertyNameStrings << properties.last().propertyNameString;
<< " });\n"
<< " }\n"
<< " }\n";
- if (parser.isSet(cppPropertyOption)) {
- headerStream << " QBindable<" << property.typeName << "> bindable" << property.capitalizedPropertyName << "() {\n"
- << " return QBindable<" << property.typeName << ">(this, " << property.propertyNameString << ");\n"
- << " }\n";
- }
+ headerStream << "#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)\n";
+ headerStream << " QBindable<" << property.typeName << "> bindable" << property.capitalizedPropertyName << "() {\n"
+ << " return QBindable<" << property.typeName << ">(this, " << property.propertyNameString << ");\n"
+ << " }\n";
+ headerStream << "#endif\n";
headerStream << " Q_INVOKABLE bool " << property.propertyName << "IsDefaultValue() const {\n"
<< " return !testPropertySet(" << i << ");\n"